# {{ descriptors.identifier }}

## Basics

PCB is {{ pcb_width_mm }}mm by {{ pcb_height_mm }}mm. Recommended thickness is standard 1.6mm. Key switch spacing is {{ keyswitch_width_mm }}mm by {{ keyswitch_height_mm }}mm.

## BOM

{% for d in bom %}* {{ d["quantity"] }} [{{ d["description"] }}](link)
{% endfor %}

## Firmware notes

Because of https://github.com/qmk/qmk_firmware/issues/8809: `make keycad/68keys:default:dfu-util EXTRAFLAGS+=--specs=nosys.specs`

## Key matrix

```
// config.h

#pragma once

#include "config_common.h"

// USB Device descriptor parameters
#define VENDOR_ID       {{ descriptors.usb_vid }}
#define PRODUCT_ID      {{ descriptors.usb_pid }}
#define DEVICE_VER      0x0001
#define MANUFACTURER    {{ descriptors.usb_manufacturer }}
#define PRODUCT         {{ descriptors.usb_product }}
#define DESCRIPTION     {{ descriptors.usb_description }}

// key matrix size
#define MATRIX_ROWS {{ matrix_pins.rows|length }}
#define MATRIX_COLS {{ matrix_pins.cols|length }}

// key matrix pins
#define MATRIX_ROW_PINS { {% for row in matrix_pins.rows %}{{ row }}{% if loop.last %}{% else %}, {% endif %}{% endfor %} }
#define MATRIX_COL_PINS { {% for col in matrix_pins.cols %}{{ col }}{% if loop.last %}{% else %}, {% endif %}{% endfor %} }
#define UNUSED_PINS

// COL2ROW or ROW2COL
#define DIODE_DIRECTION COL2ROW

#define RGB_DI_PIN {{ led_data_pin }}
#ifdef RGB_DI_PIN
    #define RGB_MATRIX_KEYPRESSES
    #define DRIVER_LED_TOTAL ({{ led_count }})
    #define RGBLED_NUM (DRIVER_LED_TOTAL)
#endif

```
---
```
// {{ descriptors.identifier }}.h

#pragma once

#include "quantum.h"

#define LAYOUT_default( {% for key in kle.keys %}{{ key.matrix_identifier }}{% if loop.last %}{% else %}, {% endif %}{% endfor %}) \
{ \{% for row in key_matrix_keys %}
    { {% for key in row %}{% if key %}{{ key.matrix_identifier }}{% else %}KC_NO{% endif %}{% if loop.last %}{% else %}, {% endif %}{% endfor %} }{% if loop.last %}{% else %},{% endif %} \{% endfor %}
}

#define LAYOUT LAYOUT_default
```
---
```
// {{ descriptors.identifier }}.c

#include "{{ descriptors.identifier }}.h"
{% if has_per_key_led %}#include "quantum/rgb_matrix.h"{% endif %}

{% if has_per_key_led %}led_config_t g_led_config = { {
  // Key Matrix to LED Index{% for row in key_matrix_keys %}
  { {% for key in row %}{% if key %}{{ key.led_identifier }}{% else %}NO_LED{% endif %}{% if loop.last %}{% else %}, {% endif %}{% endfor %} }{% if loop.last %}{% else %},{% endif %}{% endfor %}
}, {
  // LED Index to Physical Position
  {% for key in kle.keys %}{{ "{" }}{{ key.led_x }}, {{ key.led_y }}{{ "}" }}{% if loop.last %}{% else %}, {% endif %}{% endfor %}
}, {
  // LED Index to Flag
  {% for key in kle.keys %}LED_FLAG_KEYLIGHT{% if loop.last %}{% else %}, {% endif %}{% endfor %}
}
};{% endif %}

void matrix_init_kb(void) {
	// put your keyboard start-up code here
	// runs once when the firmware starts up

	matrix_init_user();
}
```
---
```
// keymaps/default/keymap.c

#include QMK_KEYBOARD_H

#define _MAIN 0

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  [_MAIN] = LAYOUT(
    {% for key in kle.keys %}{{ key.qmk_keycode }}{% if loop.last %}{% else %}, {% endif %}{% endfor %}
  )
};

```
## Debugging

`{{ args }}`
